<template>
    <div class="main-container">
        <pic url="http://aplus-img.img-cn-beijing.aliyuncs.com/20170616131449_KzSWS8XHmrYyKye255Y.png"></pic>
        <!--<p @click="goHome">回主页</p>-->
        <!--<p>{{limitTime}}s后自动跳转回主页</p>-->
    </div>
</template>
<script>
  import Storage from 'util/lib/storage'
    export default{
        data(){
            return{
                limitTime: 5,
                limitLongTime: 5
            }
        },
        computed:{

        },
        methods:{
            goHome() {//回首页
                if(Storage.get("isManager")) {
                    this.$router.replace({name: 'MHome'});
                }else {
                    this.$router.replace({name: 'home'});
                }
            }
        },
        beforeRouteEnter(to, from, next) {
            if(from.fullPath.indexOf("/manager/") != -1) {
                Storage.set("isManager", true);
            }
            next();
        },
        mounted(){
            let timer = setInterval( () => {
                this.limitTime--;
                if(this.limitTime <= 0) {
                    clearInterval(timer);
                    this.limitTime = this.limitLongTime;
                    //this.goHome();
                }
            },1000);
        }
    }
</script>
<style lang="scss" scoped>
    @import "./../../assets/sass/main";
    .pic-container{
        margin-top: 2.5rem;
        height: auto;
    }
</style>
